<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    *{
        margin: 0;
        padding: 0;
    }
    #box1{
        width: 300px;
        height: 300px;
        margin: auto;
        background: red;
        margin-top: 15%;
        overflow: hidden;
        border-radius: 100%;
    }
    #box2{
        width: 200px;
        height: 200px;
        margin: auto;
        margin-top: 50px;
        background: yellow;
        overflow: hidden;
        border-radius: 100%;
    }
    #box3{
        width: 100px;
        height: 100px;
        margin: auto;
        margin-top: 50px;
        background: lightcyan;
        overflow: hidden;
        border-radius: 100%;
    }
</style>
<body>
    
<div id="box1">
    <div id="box2">
        <div id="box3"></div>
    </div>
</div>
    
    <script>

        // document.getElementById('box1').onclick = function () {
        //     event.stopImmediatePropagation(console.log(1))
        // }
        // document.getElementById('box2').onclick = function () {
        //     event.stopImmediatePropagation(console.log(2))
        // }
        // document.getElementById('box3').onclick = function () {
        //     event.stopImmediatePropagation(console.log(3))
        // }


        

        // document
        // .getElementsByTagName('box1')[0]
        // .addEventListener('click',fun1,true)

        document.getElementsByTagName('box1') == addEventListener(
            'click',
            function () {
                console.log(1);
            },
            true
        )
        document.getElementsByTagName('box2')[0] == addEventListener(
            'click',
            function () {
                console.log(2);
            },
            false
        )
        document.getElementsByTagName('box3')[0] == addEventListener(
            'click',
            function () {
                console.log(3);
            },
            false
        )

    </script>

</body>
</html>